package com.ljh.mq.springrabbitmqdemo.listener;

import com.ljh.mq.springrabbitmqdemo.constants.Constants;
import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author: Themberfue
 * @date: 2025/4/28 21:00
 * @description:
 */
@Component
public class FanoutListener {

    private static final Logger log = LoggerFactory.getLogger(FanoutListener.class);

    @RabbitListener(queues = Constants.FANOUT_QUEUE1)
    public void process1(String message) {
        log.info("[process1]:成功接收到消息:[{}]:{}", Constants.FANOUT_QUEUE1, message);
    }

    @RabbitListener(queues = Constants.FANOUT_QUEUE2)
    public void process2(String message) {
        log.info("[process2]:成功接收到消息:[{}]:{}", Constants.FANOUT_QUEUE2, message);
    }
}
